package com.csyf.manager.dao;

import com.csyf.manager.entity.SysAgentChannel;

public class ChannelSqlProvider {

    public String updateStatus(SysAgentChannel vo) {

        StringBuffer sql = new StringBuffer("UPDATE sys_agent_channel SET status = #{status} WHERE");
        if(null != vo.getMchId() && vo.getMchId() != ""){
            sql.append("  mch_id = #{mchId}");
        }
        if(null != vo.getChannelNo() && vo.getChannelNo() != ""){
            sql.append(" AND channel_no = #{channelNo}");
        }
        if(null != vo.getMerchantNo() && vo.getMerchantNo() != ""){
            sql.append(" AND merchant_no = #{merchantNo}");
        }
        if(null != vo.getService() && vo.getService() != ""){
            sql.append(" AND service = #{service}");
        }
        return sql.toString();

    }
}
